<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ include file="/WEB-INF/view/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>系统用户添加</title>
	<meta name="decorator" content="default"/>
	<%@ include file="/WEB-INF/view/include/dialog.jsp" %>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#value").focus();
			$("#inputForm").validate({
				rules: {
				},
				messages: {
					confirmNewPassword: {equalTo: "输入与上面相同的密码"}
				},
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/sys/sysuser/">系统用户列表</a></li>
		<li class="active"><a href="${ctx}/sys/sysuser/form?id=${sysuser.id}">系统用户${empty sysuser.id?'添加':'更新'}</a></li>
	</ul>
	<form:form id="inputForm" modelAttribute="sysuser"
		action="${ctx}/sys/sysuser/${empty sysuser.id?'save':'update'}"
		method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<tags:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">用户名称:</label>
			<div class="controls" >
				<form:input path="userName" htmlEscape="false" maxlength="50" class="required username" />
			</div>
		</div>
		<c:if test="${empty sysuser.id}">
			<div class="control-group">
				<label class="control-label">密码:</label>
				<div class="controls" >
					<form:password path="password"  htmlEscape="false" minlength="6" maxlength="50" class="required " />
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">确认密码:</label>
				<div class="controls">
					<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="32" minlength="6" class="required" equalTo="#password"/>
				</div>
			</div>
		</c:if>
		<div class="control-group">
			<label class="control-label">真实名称:</label>
			<div class="controls" >
				<form:input path="realName" htmlEscape="false" maxlength="50" class="required realName" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">电话:</label>
			<div class="controls" >
				<form:input path="phone" htmlEscape="false" maxlength="50" class="phone"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">邮箱:</label>
			<div class="controls" >
				<form:input path="email" htmlEscape="false" maxlength="200" class="email"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">地址:</label>
			<div class="controls" >
				<form:input path="address" htmlEscape="false" maxlength="50"/>
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit"
				value="保 存" />&nbsp; <input id="btnCancel" class="btn" type="button"
				value="返 回" onclick="history.go(-1)" />
		</div>
	</form:form>
</body>
</html>